package com.example.mymvp2.presenter;

import android.app.Activity;

import com.example.mymvp2.BaseViewListener;
import com.example.mymvp2.bean.SendBean;
import com.example.mymvp2.modle.ResultCallback;
import com.example.mymvp2.modle.ResultToken;


public class PresenterCallbackView extends BasePresenter<SendBean> {

//    private int[] requsetPatams;
//
//    @Override
//    public BasePresenter requestParams(int... args) {
//        this.requsetPatams = args;
//        return super.requestParams(args);
//    }

    private SendBean sendBean;

    public SendBean getSendBean() {
        return sendBean;
    }

    public void setSendBean(SendBean sendBean) {
        this.sendBean = sendBean;
    }

    @Override
    public void execute(BaseViewListener<SendBean> callback) {
        SendBean bean = new SendBean();
        switch (mParams[0]) {
            case 1:
                bean = new SendBean();
                bean.msg = "成功数据";
                bean.sendCode = 2000;
                callback.showSucceedData(bean);
                break;
            case 2:
                bean = new SendBean();
                bean.msg = "失败数据";
                bean.sendCode = 2001;
                callback.showFailedData(bean);
                break;
            case 3:
                bean = new SendBean();
                bean.msg = "异常数据";
                bean.sendCode = 2002;
                callback.showExceptionData(bean);
                break;
        }
        bean = new SendBean();
        bean.msg = "传送完成";
        bean.sendCode = 2003;
        callback.showCompleteData(bean);
    }

    @Override
    public void requestGetAPI(String url, BaseViewListener<SendBean> callback) {

    }
}


